import { createStore, applyMiddleware } from 'redux'
import thunk from 'redux-thunk'
const reducer = (state = { 
  bannerList: [],
  proList: []
}, { type, payload }) => {
  switch (type) {
    case "CHANGE_BANNER_LIST":
      return Object.assign({}, state, { bannerList: payload })
    case "CHANGE_PRO_LIST":
      return Object.assign({}, state, { proList: payload })
    default:
      return state
  }
}

const store = createStore(reducer, applyMiddleware(thunk))

export default store